Skip to content

[Pipe] Preserve parser fairness and OOM retry state#18306

Open
Caideyipi wants to merge 1 commit into
apache:dev/1.3from
Caideyipi:fix/pipe-parser-fairness-retry-dev-1.3
Open

[Pipe] Preserve parser fairness and OOM retry state#18306
Caideyipi wants to merge 1 commit into
apache:dev/1.3from
Caideyipi:fix/pipe-parser-fairness-retry-dev-1.3

Conversation

@Caideyipi

@Caideyipi Caideyipi commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

Description

Backport of #18305 to dev/1.3.

The fair TsFile parser admission prerequisite has landed in dev/1.3 through #18295. This PR is rebased on that commit and now contains only the follow-up fix.

Preserve fairness across temporary queue gaps

The TsFile parser scheduler removed a single-region Pipe from the waiting order after admitting its only pending request. If that Pipe re-entered while a multi-region Pipe still had queued requests, queue insertion order could give the multi-region Pipe consecutive admissions. This change keeps a pipe-level admission cursor across temporary gaps, advances it only for requests that actually waited, and clears it once parser reservations and waiters are both idle.

Preserve scan parser state on critical OOM

A critical OOM while resizing memory for the next Tablet was handled by the generic exception path, which closed the scan parser even though the current data had not been consumed. The scan container now propagates this retryable OOM without closing so the caller can yield the parser slot and retry from the same iterator position. Other exceptions retain the existing close-and-wrap behavior.

This also preserves the two parser diagnostics required by the V1-498 test procedure:

  • failed to consume parsed tablet from TsFile
  • failed to allocate memory for parsing TsFile

Verification

  • .\mvnw.cmd clean test -pl iotdb-core/datanode -am '-Dtest=PipeMemoryManagerTest,TsFileInsertionDataContainerTest' '-Dsurefire.failIfNoSpecifiedTests=false' '-DskipITs' '-Ddevelocity.off=true'
  • Targeted suite: 22 tests, 0 failures, 0 errors.
  • Checkstyle and Spotless checks passed as part of the reactor build.
  • The rebased fix is patch-equivalent to the previously tested fix, and the worktree content is unchanged.

This PR has:

  • been self-reviewed.
  • added comments explaining non-obvious scheduling decisions.
  • added unit tests for the new admission and retry paths.

Key changed/added classes
  • PipeMemoryManager
  • PipeTsFileInsertionEvent
  • TsFileInsertionScanDataContainer
  • PipeMemoryManagerTest
  • TsFileInsertionDataContainerTest

@Caideyipi
Caideyipi force-pushed the fix/pipe-parser-fairness-retry-dev-1.3 branch from 0362574 to 1db7dfc Compare July 25, 2026 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant